<?php

class Backoffice_Model_FormGroup extends CC_Backoffice_Form
{
    /** @var Doctrine\ORM\EntityManager */
    protected $_em;
    
    public function __construct(Doctrine\ORM\EntityManager $em, $options = null)
    {
        parent::__construct($options);
        $this->_em = $em;
        
        $name = new Zend_Form_Element_Text('name');
        $name->setAttrib('size', 28)
             ->setLabel("Group Name")
             ->setRequired(true)
             ->addErrorMessage("A group name is required");
        $this->addElement($name);
        
        $parentGroup = new CC_Form_GroupSelect('parentGroup', $this->_em);
        $parentGroup->setLabel("Parent Group");
        $this->addElement($parentGroup);
        
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel("Create group")
               ->setRequired(true);
        $this->addElement($submit);
    }
}

?>